The purpose of this example is to implement a simple pie chart with the following effect:Characteristics:1. Easy to use, put in an XML layout file, and then set the content in your code, namely:Piechartview Piechartview = (piechartview) Findviewbyid (R.id.pie_chart); piechartview.pieitembean[] items = new piechartview.pieitembean[]{ new Piechartview.pieitembean ("entertainment", +),
Android: Use canvas to draw a pie chart (automatically adapts to the number/size of entries). androidcanvas
The purpose of this example is to implement a simple pie chart with the following effects:
Features:
1. Easy to use. You can place the content in the xml layout file
A bullet chart, as the name implies, is a way of thinking about the trajectory of a bullet when it is shot out. At first, the bullet chart was developed to replace the kind of odometer that is common on the instrument panel, such as the speedometer, which is based on circular information expression. The non-modified linear representation of a bullet chart allows
, Color. DKGRAY };// Set the font size of the legend.Private int legendTextSize = 30;
// Set the legend heightPrivate int legendHeight = 50;
// Set the legend colorPrivate int labelColor = Color. BLACK;
// Set the title size of a pie chartPrivate int titleSize = 50;
Private Context context;
// Used to display PieChartPrivate GraphicalView pieChartView = null;
//
option to adjust the second plot contains the last value as the appropriate number, in this case, select 4. The meaning of these two items is to select the position in the last 4 items of data to form a second plot (click the up and down arrows to adjust the number size, in the adjustment process to watch the pie chart change). Adjust the value of the second plo
content.Markpoint:Plot points, including the maximum small value, and the inflection pointMarkline:Draw a line, mean lineSplitline:falseSplit LineGrid: Setting up gridsGrid: {borderwidth:0,/* border=0 on both sides */x: ' 55px ',/* Change the size of the line chart by modifying the xy x2 y2 */Y: ' 25px ',X2: ' 20px ',Y2: ' 20px ',},Trigger:item/axis/* Triggers the style displayed by the Cue box */ToolTip:
. Data; // used for data accessUsing system. Drawing; // provides basic functions for drawing GDI + graphics.Using system. Drawing. Text; // provides advanced functions for drawing GDI + graphics.Using system. Drawing. drawing2d; // provides advanced 2D and vector graphics Functions.Using system. Drawing. imaging; // provides advanced functions for drawing GDI + graphics.These namespaces will be applied later.2. Define a namespace as insight_cs.webcharts, which includes two classes: piechart and
In the previous post we've made a line chart, and next we'll make a column and pie chart.
The drawing process of a column chart is similar to a line chart, and the following will only post the code without further explanation.
Pie
Pie chart | Line Chart | Column chart
This article will introduce you to the. NET how to use code drawing tables, just as you would with a chart generated in MS Excel. You can also sketch a DataGrid-like table.In NET, Microsoft has provided us with the drawing Class (System.
(compliant, values [2]); series. add (excellent, values [3]); return series ;}
How to Set dataset-bar chart can have multiple groups of data
1 String[] titles={test};2 List
values=new ArrayList
();3 values.add(new double[]{5120.0,21251.0,25610.0});4 XYMultipleSeriesDataset dataset=buildBarDataset(titles, values);
protected XYMultipleSeriesDataset buildBarDataset(String[] titles, List
values) {
plot (click the up and down arrows to adjust the number size, in the adjustment process to watch the pie chart change). Resize the second plot size to change the size of the stacked bar chart, and adjust the spacing to change the
Chart.js Chart Library case appreciation, pie chart Add textChart.js is an impressive library of JavaScript charts based on HTML5 Canvas. Currently, it supports 6 chart types (line chart, bar chart, radar
First:
Pie chart:
Bar chart:
Find information on the Internet, sort it out, and comment out the configurationCodeAs follows:
1. All the code for creating a pie chart
///
/// Obtain the slice chart based on
Html5: generate a pie chart and html5: generate a Statistical Chart
Here we will introduce a jQuery plug-in: jquery. easysector. js
Html5 provides a powerful drawing API that allows us to easily draw various images using javascript. This article describes how to use HTML5 to draw a pie
transparentcircle, transparentcircle inside is hole, so the middle of the pie chart of the Hollow is a concentric circle. The code is as follows:
self.pieChartView.drawHoleEnabled = yes;//Whether the pie chart is hollow
Self.pieChartView.holeRadiusPercent = 0.5;//Hollow radius ratio
Self.pieChartView.
, MYDEC);Draw the text on the right side of the small squareG. DrawString (Ixiaosh[i]. ToString (), New Font ("Song Body", 9), brushes. Black, mytxt);Myrec. Y + 15;MyDec. Y + 15;Mytxt. Y + 15;}The following code draws the fan type based on the numeric size obtained from the database, fills the fan type with the appropriate color, and/or makes up the pie chart in
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.